/**
 * @author liangxi
 * @since 2023/12/21
 */

#ifndef DESIGNPATTERN_LIGHTOFFCOMMAND_H
#define DESIGNPATTERN_LIGHTOFFCOMMAND_H

#include "../Command.h"
#include "../../Pojo/Light.h"

namespace CommandSR {

    /**
     * 将Light的每一种行为封装成一个类，由统一的execute接口暴露出来
     */
    class LightOffCommand : public CommandSR::Command {
    public:
        explicit LightOffCommand(const Light &l) : light(l) {}

        void execute() override {
            light.off();
        }

    private:
        Light light;
    };

} // CommandSR

#endif //DESIGNPATTERN_LIGHTOFFCOMMAND_H
